home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / include / scribus-ng / canvasmode_legacy.h < prev    next >
Encoding:
C/C++ Source or Header  |  2009-02-15  |  2.7 KB  |  98 lines

  1. /*
  2.  For general Scribus (>=1.3.2) copyright and licensing information please refer
  3.  to the COPYING file provided with the program. Following this notice may exist
  4.  a copyright and/or license notice that predates the release of Scribus 1.3.2
  5.  for which a new license (GPL+exception) is in place.
  6.  */
  7. /***************************************************************************
  8. *                                                                         *
  9. *   This program is free software; you can redistribute it and/or modify  *
  10. *   it under the terms of the GNU General Public License as published by  *
  11. *   the Free Software Foundation; either version 2 of the License, or     *
  12. *   (at your option) any later version.                                   *
  13. *                                                                         *
  14. ***************************************************************************/
  15.  
  16.  
  17.  
  18. #ifndef CANVAS_MODE_LEGACY_H
  19. #define CANVAS_MODE_LEGACY_H
  20.  
  21. #include <QObject>
  22. #include <QTime>
  23.  
  24. #include "canvasmode.h"
  25. #include "fpointarray.h"
  26.  
  27. class LineMove;
  28. class PageItem;
  29. class PageItem_TextFrame;
  30. class QTimer;
  31. class ResizeGesture;
  32. class RulerGesture;
  33. class ScribusMainWindow;
  34. class ScribusView;
  35.  
  36.  
  37. // This class encapsulate the old code for mouse interaction from scribusview.cpp
  38.  
  39. class LegacyMode :  public CanvasMode
  40. {
  41.     Q_OBJECT
  42.     
  43. public:
  44.     LegacyMode(ScribusView* view);
  45.  
  46.     virtual void enterEvent(QEvent *);
  47.     virtual void leaveEvent(QEvent *);
  48.     
  49.     virtual void activate(bool);
  50.     virtual void deactivate(bool);
  51.     virtual void mouseDoubleClickEvent(QMouseEvent *m);
  52.     virtual void mouseReleaseEvent(QMouseEvent *m);
  53.     virtual void mouseMoveEvent(QMouseEvent *m);
  54.     virtual void mousePressEvent(QMouseEvent *m);
  55.     virtual void drawControls(QPainter* p);
  56.  
  57. // protected:
  58. //     void setResizeCursor(int);
  59.  
  60. private:
  61.     inline bool GetItem(PageItem** pi);
  62.     void drawTextCursor(QPainter* p, PageItem_TextFrame* textframe);
  63.     void selectPage(QMouseEvent *m);
  64.     bool SeleItem(QMouseEvent *m);
  65.     void SetupDraw(int Nr);
  66.     void SetupDrawNoResize(int nr);
  67.     void createContextMenu(PageItem *currItem, double mx, double my);
  68.     int HandleSizer(PageItem *currItem, QRect mpo, QMouseEvent *m);
  69.  
  70.     int Cp, oldCp;
  71.     bool inItemCreation, shiftSelItems, FirstPoly;
  72.     int frameResizeHandle;
  73.     int RotMode;
  74.     int dragConstrainInitPtX, dragConstrainInitPtY;
  75.     double Mxp, Myp, Dxp, Dyp;
  76.     int GxM, GyM;
  77.     double SeRx, SeRy;
  78.     bool MoveGX, MoveGY;
  79.     FPointArray RecordP;
  80.     ScribusMainWindow* m_ScMW;
  81.     ResizeGesture* resizeGesture;
  82.     LineMove* lineMoveGesture;
  83.     RulerGesture* guideMoveGesture;
  84.     bool m_cursorVisible;
  85.     QTime m_blinkTime;
  86.     QTimer* m_blinker;
  87.     bool m_lastPosWasOverGuide;
  88.  
  89. public slots:
  90.     void importToPage();
  91.  
  92. private slots:
  93.     void blinkTextCursor();
  94. };
  95.  
  96.  
  97. #endif
  98.